package com.ruoyi.stock2.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock2.mapper.SearchFromEsIndustryMapper;
import com.ruoyi.stock2.domain.SearchFromEsIndustry;
import com.ruoyi.stock2.service.ISearchFromEsIndustryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 从es中查询与模型相似股票的行业Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-08
 */
@Service
public class SearchFromEsIndustryServiceImpl implements ISearchFromEsIndustryService
{
    @Autowired
    private SearchFromEsIndustryMapper searchFromEsIndustryMapper;

    /**
     * 查询从es中查询与模型相似股票的行业
     *
     * @param id 从es中查询与模型相似股票的行业ID
     * @return 从es中查询与模型相似股票的行业
     */
    @Override
    public SearchFromEsIndustry selectSearchFromEsIndustryById(Long id)
    {
        return searchFromEsIndustryMapper.selectSearchFromEsIndustryById(id);
    }

    /**
     * 查询从es中查询与模型相似股票的行业列表
     *
     * @param searchFromEsIndustry 从es中查询与模型相似股票的行业
     * @return 从es中查询与模型相似股票的行业
     */
    @Override
    public List<SearchFromEsIndustry> selectSearchFromEsIndustryList(SearchFromEsIndustry searchFromEsIndustry)
    {
        return searchFromEsIndustryMapper.selectSearchFromEsIndustryList(searchFromEsIndustry);
    }

    /**
     * 新增从es中查询与模型相似股票的行业
     *
     * @param searchFromEsIndustry 从es中查询与模型相似股票的行业
     * @return 结果
     */
    @Override
    public int insertSearchFromEsIndustry(SearchFromEsIndustry searchFromEsIndustry)
    {
        return searchFromEsIndustryMapper.insertSearchFromEsIndustry(searchFromEsIndustry);
    }

    /**
     * 修改从es中查询与模型相似股票的行业
     *
     * @param searchFromEsIndustry 从es中查询与模型相似股票的行业
     * @return 结果
     */
    @Override
    public int updateSearchFromEsIndustry(SearchFromEsIndustry searchFromEsIndustry)
    {
        return searchFromEsIndustryMapper.updateSearchFromEsIndustry(searchFromEsIndustry);
    }

    /**
     * 删除从es中查询与模型相似股票的行业对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSearchFromEsIndustryByIds(String ids)
    {
        return searchFromEsIndustryMapper.deleteSearchFromEsIndustryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除从es中查询与模型相似股票的行业信息
     *
     * @param id 从es中查询与模型相似股票的行业ID
     * @return 结果
     */
    @Override
    public int deleteSearchFromEsIndustryById(Long id)
    {
        return searchFromEsIndustryMapper.deleteSearchFromEsIndustryById(id);
    }

    @Override
    public int deleteSearchFromEsIndustryByDate(Date createDate) {
        return searchFromEsIndustryMapper.deleteSearchFromEsIndustryByDate(createDate);
    }
}
